package com.vanke.gankclient.base

import rx.Subscription
import rx.subscriptions.CompositeSubscription

/**
 * @name GankClient
 * @package name：com.vanke.gankclient.base
 * @class describe
 * @anthor shiyuchuan
 * @time 2017/8/10 16:08
 */
open class BasePresenter{

   var compositeSubscription = CompositeSubscription()

    protected fun addSubscription(subscription: Subscription) {
        compositeSubscription.add(subscription)
    }

    fun unSubscription() {
        if (compositeSubscription.hasSubscriptions())
            compositeSubscription.unsubscribe()
    }
}